use std::ops::Sub;
use std::time::Instant;
use stress_test::config::log;

#[tokio::main]
async fn main() {
    let _guard = log::init_log();
    let client = reqwest::Client::new();
    tracing::info!("reqwest client initialized.");
    let s = Instant::now();
    let res = client.get("http://127.0.0.1:7878/").send().await.unwrap().text().await.unwrap();
    tracing::debug!("{res}");
    let join_handle = tokio::spawn(async {
        for i in 0..10 {
            tracing::info!("hi number {} from the spawned thread!", i);
        }
    });
    for i in 0..10 {
        tracing::info!("hi number {} from the main thread!", i);
    }
    join_handle.await.unwrap();
    tracing::info!("{:?}",Instant::now().sub(s));
}
